<template>
    <div id="app">
        <div class="app_top">
        </div>
        <Loading_cp></Loading_cp>
        <router-view></router-view>
        <Share_file_cp></Share_file_cp>
        <Delete_file_cp></Delete_file_cp>
        <Unshare_file_cp></Unshare_file_cp>
        <Upload_file_cp></Upload_file_cp>
    </div>
</template>

<script>

import Loading_cp from '@/components/public_cp/loading'
import Share_file_cp from '@/components/public_dialog/share_file'
import Delete_file_cp from '@/components/public_dialog/delete_file'
import Unshare_file_cp from '@/components/public_dialog/unshare_file'
import Upload_file_cp from '@/components/public_dialog/upload_file'
export default {
    name: 'App',
    components: {
        Loading_cp,
        Share_file_cp,
        Unshare_file_cp,
        Delete_file_cp,
        Upload_file_cp,
    },
    watch:{
        $route:{
            handler(){
                this.$store.commit('remove_search_data');
            },
            // 深度观察监听
            deep: true,
        }
    },
    created(){      
        document.oncontextmenu = function(){  //阻止原鼠标右击默认事件
            return false;
        }
        //初始化用户数据
        let user_data = sessionStorage.getItem('user_data');
        if(user_data){
            this.$store.commit('set_user_data',JSON.parse(user_data));
        }
    },
}
</script>

<style>
#app {
    font-family: Avenir, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #2b2e4a;
}
.app_top{
    border-top: 1px solid #f4f4f4;
    width: 100%;
    position:fixed;
    top: 0;
    z-index: 9999;
}
</style>
